home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / seteuid.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.7 KB  |  67 lines

  1.  
  2.  
  3.  
  4. SETUID(3)           MINTLIB LIBRARY FUNCTIONS           SETUID(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        setuid, setgid - set user and group IDs
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        int setuid(int uid);
  14.        int setgid(int gid);
  15.  
  16. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  17.        setuid  (setgid)  is  used to set the real user (group) ID
  18.        and effective user (group) ID of the calling process.
  19.  
  20.        If the effective user ID of the calling process is  super-
  21.        user,  the real user (group) ID and effective user (group)
  22.        ID are set to uid (gid).
  23.  
  24.        If the effective user ID of the  calling  process  is  not
  25.        super-user,  but  its real user (group) ID is equal to uid
  26.        (gid), the effective user (group) ID is set to uid  (gid).
  27.  
  28.        setuid  (setgid)  will fail if the real user (group) ID of
  29.        the calling process is not equal  to  uid  (gid)  and  its
  30.        effective user ID is not super-user.
  31.  
  32. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  33.         0  on success -1 on failure; errno is set to indicate the
  34.        error.
  35.  
  36. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  37.        g✓ge✓et✓tu✓ui✓id✓d(✓(3✓3)✓),✓, g✓ge✓et✓tg✓gi✓id✓d(✓(3✓3)✓),✓, g✓ge✓et✓te✓eu✓ui✓id✓d(✓(3✓3)✓),✓, g✓ge✓et✓te✓eg✓gi✓id✓d(✓(3✓3)✓),✓,  P✓Ps✓se✓et✓tu✓ui✓id✓d(✓(2✓2)✓),✓,
  38.        P✓Ps✓se✓et✓tg✓gi✓id✓d(✓(2✓2)✓)
  39.  
  40. N✓NO✓OT✓TE✓ES✓S
  41.        The  related  functions  seteuid,  setegid,  setreuid  and
  42.        setregid are also available in the MiNTlibs but really are
  43.        the same.
  44.  
  45. B✓BU✓UG✓GS✓S
  46.        When MiNT is not active, these calls are pretty bogus.
  47.  
  48.        Security  in  MiNT is a joke; don't rely on these calls to
  49.        actually protect you from anything, it's more for informa-
  50.        tional purposes.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.